<template>
  <el-row :gutter="20">
    <!-- column 列 -->
    <el-col :span="6" v-for="item in list" :key="item.id">
      <div class="grid-content">
        <i
          class="iconfont"
          :style="{ color: item.color }"
          :class="item.icon"
        ></i>
        <div>
          <h4>{{ item.name }}</h4>
          <p>{{ item.count | calcNum }}</p>
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  filters: {
    calcNum(val) {
      val -= 0
      return val.toFixed(1).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
    }
  }
}
</script>

<style lang="less" scoped>
.grid-content {
  border-radius: 4px;
  min-height: 36px;
  background: #fff;
  padding: 10px 20px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  i {
    font-size: 44px;
  }

  h4 {
    margin: 0;
    // font-weight: normal;
    color: #ccc;
  }
  p {
    margin: 0;
    color: #333;
    font-weight: 700;
  }
}
</style>
